package com.anime.adapter;

import android.annotation.SuppressLint;
import android.graphics.Color;

import androidx.annotation.Nullable;


import com.animes.R;
import com.blankj.utilcode.util.LogUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

public  class AnimeTypeAdapter  extends BaseQuickAdapter<String, BaseViewHolder> {
    private int index;

    public AnimeTypeAdapter(int layoutResId, @Nullable @org.jetbrains.annotations.Nullable List<String> data) {
        super(layoutResId, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, String item) {

        helper.setText(R.id.tv_type,item);
        if(index==helper.getAdapterPosition()){
            helper.setTextColor(R.id.tv_type, Color.parseColor("#FFC0CB"));
       helper.setVisible(R.id.view,true);
        }else {
            helper.setTextColor(R.id.tv_type, Color.parseColor("#808080"));
           helper.setVisible(R.id.view,false);
        }
    }

    public void setIndex(int index) {
        this.index = index ;
    }
}
